include <iostream>
using namespace std;

int func1(int x){
    int count = 0;
    while (x){
        count++;
        x = x & (x-1);
    }
    return count;
}

void test1(){
    cout << func1(9999);
}

void func2(char **m){
    ++m;
    cout << *m << endl;
}

void test2(){
    static char *a[] = {"morning","afternoon","evening"};
    char **p = a;
    func2(p);
}

struct s1{
    int i;
    short b;
    int c;
    char c2;
};
struct s2{
    int i;
    short b;
    char c2;
    int c;

};

void test3(){
    cout << sizeof(struct s1) << sizeof(struct s1) << endl;
}

void test4(){
    int m = 0123;
    int n = 123;
    printf("%o %o\n",m,n);
    cout << m;
}

int cnt = 0;
int fib(int n){
    cnt++;
    if(n==0)
        return 1;
    else if (n==1)
        return 2;
    else
        return fib(n-1) + fib(n-2);
}
void test5(){
    fib(8);
    cout << cnt;
}

void test6(){
    int a[5] = {1,3,5,7,9};
    int *p = (int *)&a + 1;
}

void Test1(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int A = (a + c) / 2;
    int B = c - A;
    int C = d - B;
    if ((A+B+C) > 0 && (A+B+C) < 60)
        cout << A << " " << B << " " << C << endl;
    else
        cout << "No" << endl;
}

#include <algorithm>

void Test2(){
    int a, b;
    string mod = "0123456789ABCDEF";
    bool flag = false;
    while (cin >> a >> b) { // 注意 while 处理多个 case
        string s;
        if(a < 0){
            flag = true;
            a = -a;
        }
        if (a == 0) {
            cout << "0" << endl;
            continue;
        } else {
            while (a) {
                s += mod[a % b];
                a = a / b;
            }
            reverse(s.begin(), s.end());
        }
        if(flag)
            cout << "-" << s << endl;
        else
            cout << s << endl;
    }
}

